[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 break                   break Statement

 break;

    The break statement terminates the execution of the innermost
    enclosing do, for, while or switch statement.  Control is then
    transferred to the statement following the terminated loop.

      Notes:    If the break keyword appears in any other context, a
                syntax error is generated.

                `Break' terminates only the innermost loop. To leave an
                outer loop from within an inner (nested) loop, you can
                use the return or (shudder) goto statements.

                There is distinct difference between the effects of
                `break' and `continue':  `break' actually exits the loop,
                whereas continue skips the remainder of the body, and
                then continues the loop with the next iteration.

   -------------------------------- Example ---------------------------------

           while (1) {
               if (condition)
                   break;
               ...
           }
           next-statement;



See Also: do for while switch goto return continue
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson